package com.itheima.hotel.data;

import java.util.Objects;

/*
数据层

 */
public class RoomsData {
    private String roomNumber; //房间编号
    private String roomType;//房间类型
    private boolean isReserved;//是否预定

    public RoomsData() {
    }

    public RoomsData(String roomNumber, String roomType, boolean isReserved) {
        this.roomNumber = roomNumber;
        this.roomType = roomType;
        this.isReserved = isReserved;
    }

    public String getRoomNumber() {
        return roomNumber;
    }

    public void setRoomNumber(String roomNumber) {
        this.roomNumber = roomNumber;
    }

    public String getRoomType() {
        return roomType;
    }

    public void setRoomType(String roomType) {
        this.roomType = roomType;
    }

    public boolean isReserved() {
        return isReserved;
    }

    public void setReserved(boolean reserved) {
        isReserved = reserved;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RoomsData roomsData = (RoomsData) o;
        return isReserved == roomsData.isReserved && Objects.equals(roomNumber, roomsData.roomNumber) && Objects.equals(roomType, roomsData.roomType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(roomNumber, roomType, isReserved);
    }

    @Override
    public String toString() {
        return "RoomsData{" +
                "房间编号='" + roomNumber + '\'' +
                ", 房间类型='" + roomType + '\'' +
                ", 房间状态=" + (isReserved==true?"已预订":"空房") +
                '}';
    }
}
